/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class CreateCamRegData {
	public void createTestData() throws PersistentException {
		PersistentTransaction t = orm.CamRegPersistentManager.instance().getSession().beginTransaction();
		try {
			orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
			orm.dao.Cam_reporteDAO lormCam_reporteDAO = lDAOFactory.getCam_reporteDAO();
			orm.Cam_reporte lormCam_reporte = lormCam_reporteDAO.createCam_reporte();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : ti_id_tipo_reporte, re_coordenadas, re_fecha
			lormCam_reporteDAO.save(lormCam_reporte);
			orm.dao.Cam_tipo_reporteDAO lormCam_tipo_reporteDAO = lDAOFactory.getCam_tipo_reporteDAO();
			orm.Cam_tipo_reporte lormCam_tipo_reporte = lormCam_tipo_reporteDAO.createCam_tipo_reporte();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : cam_reporte, ti_descripcion
			lormCam_tipo_reporteDAO.save(lormCam_tipo_reporte);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			CreateCamRegData createCamRegData = new CreateCamRegData();
			try {
				createCamRegData.createTestData();
			}
			finally {
				orm.CamRegPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
